package com.cnunicom.modules.tra.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cnunicom.common.utils.Constant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 单位会员表，与单位表相关联
 *
 * @author dzygod
 * @email dingziyuan0@gmail.com
 * @date 2019-11-27 16:44:19
 */
@Data
@TableName("tra_member")
public class MemberEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "人员表主键")
    @TableId
    private Integer id;

    @ApiModelProperty(value = "关联上级id")
    @NotNull(message = "关联id不能为空")
    private Long superiorId;

    @ApiModelProperty(value = "类型 0:单位会员 1:职工会员")
    @NotNull(message = "类型不能为空")
    private Integer type;

    @ApiModelProperty(value = "会员姓名")
    @NotBlank(message = "姓名不能为空")
    private String name;

    @ApiModelProperty(value = "会员手机号")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = Constant.REGULAR_PHONE, message = "手机号格式错误")
    private String mobileNum;

    @ApiModelProperty(value = "身份证号码")
    private String idCard;

    @ApiModelProperty(value = "生日")
    @NotBlank(message = "生日不能为空")
    private String birthday;

    @ApiModelProperty(value = "开放平台unionId")
    private String unionId;

    @ApiModelProperty(value = "逻辑删除")
    @TableLogic
	private Integer isDel;

	@ApiModelProperty(value = "注册时间")
	private String createTime;

    @ApiModelProperty(value = "日注册会员人数")
    @TableField(exist = false)
    private String dailyMembers;


    private String def0;

    private String def1;
}
